﻿using System;
using Flurl.Http.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace Extensions.Services;

public static class AddFurlHttpClient
{
    public static IServiceCollection AddFurlHttpClientSetup(this IServiceCollection services)
    {
        ArgumentNullException.ThrowIfNull(services);
        services.AddSingleton<IFlurlClientFactory, PerBaseUrlFlurlClientFactory>();
        return services;
    }
}